package org.ch03.job.test02;

import java.lang.reflect.Constructor;

/**
 * @author XCH
 * @date 2025 - 03 - 26
 */
public class MainTest {
    public <T> T TClass(Class<T> clazz) throws Exception {
        Constructor<T> constructor = clazz.getDeclaredConstructor();
        return constructor.newInstance();

    }

    public static void main(String[] args) throws Exception {
        MainTest mainTest = new MainTest();
        User user = mainTest.TClass(User.class);
        user.setDate("张三");
        System.out.println(user.getDate());
        System.out.println(user.GenericsClass("李四"));

    }
}
